# Contributor: Sean McAvoy <seanmcavoy@gmail.com>
# Maintainer: Sean McAvoy <seanmcavoy@gmail.com>
pkgname=partclone
pkgver=0.3.14
pkgrel=0
pkgdesc="utilities to save and restore used blocks on a partition"
url="https://partclone.org"
arch="all !mips64" # missing hfsprogs on mips64
license="GPL-2.0-only"
makedepends="e2fsprogs-dev btrfs-progs-dev ntfs-3g-dev f2fs-tools-dev hfsprogs
	ncurses-dev automake autoconf libxslt-dev docbook-xml libbsd libtool
	libuuid patchutils intltool gettext-dev openssl-dev diffutils"
subpackages="$pkgname-doc $pkgname-lang"
source="$pkgname-$pkgver.tar.gz::https://github.com/Thomas-Tsai/partclone/archive/$pkgver.tar.gz
	musl.patch
	"
# musl.patch taken from voidlinux

prepare() {
	cd "$builddir"/src
	default_prepare
	autoreconf -vif
}

build() {
	# xfs seems broken right now :(
	LIBS="-lintl" \
		./configure --prefix=/usr \
		--disable-rpath \
		--enable-ncursesw \
		--enable-fat \
		--enable-extfs \
		--enable-exfat \
		--enable-ntfs \
		--enable-btrfs \
		--enable-minix \
		--enable-f2fs \
		--enable-hfsp
	make
}
check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

}

sha512sums="bf2829b9a21b8140b0b4925a8dff6252e72d800a648e69d02fa3ddcd0a7737cd13bf4d1feb015f8a397b91f8e745fd95bd8f7d7abb1d88a9c73a45881123403e  partclone-0.3.14.tar.gz
45904139a559a17fbe20ec7df52d3f3c7fcdf9305d50e1ae00b667133146098aac1825ce898a0dac25e78c8dcbcfdef7696ae740ff977e45e3ada0f8427d0dfa  musl.patch"
